#ifndef CARDDATACLASS_H
#define CARDDATACLASS_H

#include <string>
#include "PowerFlags.h"
#include <stack>
#include "dxManager.h"
using namespace std;

class CardData				//A class to represent a card
{
private:
//Private Members that describe the card itself.
	string name;
	int points;
	int color;				// The int that will hold the bit-flags for the cards color.
	int features;			// Same as above, but will hold the information for the cards features/attributes.
	string power;			// The human readable string describing the card power to the player.  Displayed on screen.
	int ID;					// The cards unique identifing number

//Private members that describe the effects of the cards power.  A card could have more than one or none of these.
	int value;
	int targetInfluence;
	int	targetArea;
	int targetAttributes;
	int targetColor;
	int targetID;

	IDirect3DSurface9* cardImage;

public:
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	IDirect3DSurface9* GetCardImage() {return cardImage;}
	void SetCardImage(dxManager* dxMgr)
	{
		char name[256];
		char strID[10];

		strcpy_s(name, 256, "./BMP/Decks/");
		itoa(ID, strID, 10);
		strcat_s(name, 256, strID);
		strcat_s(name, 256, ".bmp");

		cardImage = dxMgr->getSurfaceFromBitmap(name);
	}

	~CardData()
	{
		if(cardImage != NULL)
		{
			cardImage->Release();
			cardImage = NULL;
		}
	}

	CardData(){cardImage = NULL;}
	CardData(const CardData& card);
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/*	SET(INPUT) FUNCTIONS  */
	void setName(string aName);
	void setPoints(int aPointValue);
	void setColor(int aColor);
	void setFeatures(int aFeature);
	void setPower(string aPower);
	void setID(int anID);			//<--Probably shouldn't be used...for obvious reasons
		//For setting the target information
	void setValue(int aValue);
	void setInfluence(int anInfluence);
	void setTargetArea(int aTarget);
	void setTargetAttributes(int anAttribute);
	void setTargetColor(int aColor);
	void setTargetID(int ID);

/*  GET(OUTPUT) FUNCTIONS */
	string getName();
	int getPoints();
	int getColor();
	int getFeatures();
	string getPower();
	int getID();
		//For getting the target information
	int getValue();
	int getInfluence();
	int getTargetArea();
	int getTargetAttributes();
	int getTargetColor();
	int getTargetID();

/*	RESOLVE POWER FUNCTIONS */
	void ResolvePower(CardData homeField[], CardData oppositeField[]);
	bool AttributesMatch(CardData theOtherCard);
	bool ColorsMatch(CardData theOtherCard);
	bool IDMatch(CardData theOtherCard);

/*  Drawing Function(s)  */			//<--Will probably need to include directx here for obvious reasons
	void drawCardSmall();		//To draw the small version of the card (used in hand and in play)
	void drawCardLarge();		//To draw the larger preview version of the card in the heads up area (heads up area?)
};
#endif